<?php
include_once('common/header.php');			
if($AppUI->id <=0) {
	Vfriend_Function::redirect(HOST_VFRIEND);
}
$objNews 	= new News();
$intNewsId	= $objRequest->getParam('newsid', 0);
$strRefer	= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : LINK_NEWS;
$intError	= 0;
$arrRow		= $objNews->get($intNewsId);
if(isset($arrRow['status']) && abs($arrRow['status']) > 1) {
	$intError = 9; // deleted
}
if(isset($arrRow['userid']) && $arrRow['userid'] != $AppUI->id) {
	$intError = 10; // no perm
}
if(isset($arrRow) && $intError == 0) {		
	$this->view->row 	= $arrRow;
	$this->view->refer	= $strRefer;
	$objCommon				 = new Vfriend_Common();
	$this->view->arrCateNews = $objCommon->getCategoryByType(10);
} else {
	Vfriend_Function::setMsg($arrMessage[8]);
	Vfriend_Function::redirect($strRefer);
}
?>
